#ifndef _RELAY_CP_HPP
#define _RELAY_CP_HPP 1

#include "MacMessage.hpp"
#include "../statemanagement/CheckPointState.hpp"

namespace BFT
{
	namespace order
	{
		namespace messages
		{
			class RelayCP : public BFT::messages::MacMessage
			{
				public:
				
				RelayCP(boost::shared_ptr<BFT::order::statemanagement::CheckPointState> _cps, uint32_t _sendingReplica);
				
				RelayCP(boost::shared_ptr<char> _bytes, int _bytes_size);
				
				uint32_t getSequenceNumber(); //inlined
				
				boost::shared_ptr<BFT::order::statemanagement::CheckPointState> getCheckPoint(); //inlined
				
				uint32_t getSendingReplica(); //inlined
				
				static uint32_t computeSize(boost::shared_ptr<BFT::order::statemanagement::CheckPointState> _cps);
				
				protected:
				
				boost::shared_ptr<BFT::order::statemanagement::CheckPointState> checkPoint; 
			};
			
			inline uint32_t RelayCP::getSequenceNumber() {return checkPoint.get()->getCurrentSequenceNumber();}
			inline boost::shared_ptr<BFT::order::statemanagement::CheckPointState> RelayCP::getCheckPoint() {return checkPoint;}
			inline uint32_t RelayCP::getSendingReplica() {return getSender();}
		}
	}
}

#endif
